﻿using System;
using System.Data;
using BIS.Utility.DAL.DataMapper;
using BIS.Utility.Converter;

namespace BIS.Portal.Modules.CMS.Entity
{
    public class AdminCmsMediaEntity : IEntity
    {
        #region PrivateMember
        private int _media_id;
        private int _language_in_use_id;
        private string _media_title;
        private string _media_description;
        private int _media_type;
        private string _media_src;
        private string _media_link;
        private string _media_thumbnails;
        private DateTime _last_update;
        private string _last_update_by;
        private int _status;
        #endregion

        #region Properties

        public int MediaId
        {
            get { return _media_id; }
            set { _media_id = value; }
        }

        public int LanguageInUseId
        {
            get { return _language_in_use_id; }
            set { _language_in_use_id = value; }
        }

        public string MediaTitle
        {
            get { return _media_title; }
            set { _media_title = value; }
        }

        public string MediaDescription
        {
            get { return _media_description; }
            set { _media_description = value; }
        }

        public int MediaType
        {
            get { return _media_type; }
            set { _media_type = value; }
        }

        public string MediaSrc
        {
            get { return _media_src; }
            set { _media_src = value; }
        }

        public string MediaLink
        {
            get { return _media_link; }
            set { _media_link = value; }
        }

        public string MediaThumbnails
        {
            get { return _media_thumbnails; }
            set { _media_thumbnails = value; }
        }

        public DateTime LastUpdate
        {
            get { return _last_update; }
            set { _last_update = value; }
        }

        public string LastUpdateBy
        {
            get { return _last_update_by; }
            set { _last_update_by = value; }
        }

        public int Status
        {
            get { return _status; }
            set { _status = value; }
        }

        #endregion
        #region Constructors

        public AdminCmsMediaEntity()
        {
        }

        public AdminCmsMediaEntity(int mediaId, int languageInUseId, string mediaTitle, string mediaDescription, int mediaType, string mediaSrc, string mediaLink, string mediaThumbnails, DateTime lastUpdate, string lastUpdateBy, int status)
        {
            _media_id = mediaId;
            _language_in_use_id = languageInUseId;
            _media_title = mediaTitle;
            _media_description = mediaDescription;
            _media_type = mediaType;
            _media_src = mediaSrc;
            _media_link = mediaLink;
            _media_thumbnails = mediaThumbnails;
            _last_update = lastUpdate;
            _last_update_by = lastUpdateBy;
            _status = status;
        }

        #endregion

        #region Implement
        public void Fill(System.Data.IDataReader reader)
        {
            MediaId = Functions.GetInt(reader["media_id"]);
            LanguageInUseId = Functions.GetInt(reader["language_in_use_id"]);
            MediaTitle= Functions.GetString(reader["media_title"]);
            MediaDescription = Functions.GetString(reader["media_description"]);
            MediaType = Functions.GetInt(reader["media_type"]);
            MediaSrc = Functions.GetString(reader["media_src"]);
            MediaLink = Functions.GetString(reader["media_link"]);
            MediaThumbnails = Functions.GetString(reader["media_thumbnails"]);
            LastUpdate = Functions.GetDateTime(reader["last_update"]);
            LastUpdateBy = Functions.GetString(reader["last_update_by"]);
            Status = Functions.GetInt(reader["status"]);
        }

        #endregion

    }
}
